import request from '@/utils/request.js'

export function changePassword(obj){//修改个人信息
	return request({
		url:'admin/user/edit',
		method:'PUT',
		params:obj,
	})
}

export function user(id){//查询用户
	return request({
		url:'admin/user/' + id,
		method:'GET'
	})
}

export function version(id){//查询当前版本
	return request({
		url:'admin/sysappversion/' + id,
		method:'GET'
	})
}

export function save(obj){//意见反馈储存
	return request({
		url:'admin/sysFeedBack/save',
		method:'POST',
		params:obj
	})
}

export function lastestVersion(){//获取最新app版本
	return request({
		url:'admin/sysappversion/getLastestVersion',
		method:'GET'
	})
}

export function lastestVersionUrl(){//获取最新app版本链接
	return request({
		url:'admin/sysappversion/getLastestVersionUrl',
		method:'GET'
	})
}

export function messageNumber(){//获取消息通知未读条数
	return request({
		url:'admin/sysnotice/unread',
		method:'GET'
	})
}

export function message(page,size){//获取消息通知
	return request({
		url:'admin/sysnotice/findSystem?pageNo=' + page + '&pageSize=' + size,
		method:'GET'
	})
}

export function messageStatus(obj){//改变消息通知状态
	return request({
		url:'admin/sysnotice/read',
		method:'POST',
		params:obj
	})
}

export function remindWarningNumber(){//获取预警通知未读条数
	return request({
		url:'admin/syswarnlogs/countNotRead',
		method:'GET'
	})
}

export function remindWarning(page,size){//获取预警通知
	return request({
		url:'admin/syswarnlogs/stationUserLogsPage?pageNo=' + page +'&pageSize=' + size,
		method:'GET',
	})
}

export function remindWarningStatus(id){//改变已读预警通知状态
	return request({
		url:'admin/syswarnlogs/updateRead/'+ id,
		method:'PUT'
	})
}

export function pdfFile(id){//获取PDF文件
	return request({
		url:'admin/sys-file/getFileInfoById'+id,
		method:'GET'
	})
}

export function fileByNmae(name){//获取文件信息-name
	return request({
		url:'admin/sys-file/getFile?fileName='+name,
		method:'GET',
		options: {
			responseType: 'arraybuffer',
		}
		
	})
}

export function fileById(id){//获取文件信息-id
	return request({
		url:'admin/sys-file/getFileById?id='+id,
		method:'GET',
		options: {
			responseType: 'arraybuffer',
		}
	})
}

// export function uploadFile(id){//
// 	return request({
// 		url:'admin/sys-file/upload?path=avatar',
// 		method:'POST',
// 		params:id
// 	})
// }